#include <iostream>
#include <vector>
using namespace std;

int m, n;
// 递归
int recursion(int i, int j){
    if(i == m || j == n) return 1;
    return recursion(i+1, j) + recursion(i, j+1);
}

// 动态规划
int Help(){
    vector<vector<int>> res(n+1, vector(m+1, 0));
    res[0][0] = 1;
    for(size_t i = 0; i <= n; ++i){
        for(size_t j = 0; j <= m; ++j){
            // i == 0 || j == 0 在横轴或纵轴上只有一种走法
            if(i != 0)
                res[i][j] += res[i-1][j];
            if(j != 0)
                res[i][j] += res[i][j-1];
        }
    }
    return res[n][m];
}

int main()
{
    while(cin >> n >> m)
        cout << Help() << endl;
    return 0;
}